package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.YyHospitalDepartment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YyHospitalDepartmentMapper;
import com.ruoyi.system.service.IYyHospitalDepartmentService;
import com.ruoyi.common.core.text.Convert;

/**
 * 科室Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-25
 */
@Service
public class YyHospitalDepartmentServiceImpl implements IYyHospitalDepartmentService
{
    @Autowired
    private YyHospitalDepartmentMapper yyHospitalDepartmentMapper;

    /**
     * 查询科室
     *
     * @param departmentId 科室主键
     * @return 科室
     */
    @Override
    public YyHospitalDepartment selectYyHospitalDepartmentByDepartmentId(Long departmentId)
    {
        return yyHospitalDepartmentMapper.selectYyHospitalDepartmentByDepartmentId(departmentId);
    }

    /**
     * 查询科室列表
     *
     * @param yyHospitalDepartment 科室
     * @return 科室
     */
    @Override
    public List<YyHospitalDepartment> selectYyHospitalDepartmentList(YyHospitalDepartment yyHospitalDepartment)
    {
        return yyHospitalDepartmentMapper.selectYyHospitalDepartmentList(yyHospitalDepartment);
    }

    /**
     * 新增科室
     *
     * @param yyHospitalDepartment 科室
     * @return 结果
     */
    @Override
    public int insertYyHospitalDepartment(YyHospitalDepartment yyHospitalDepartment)
    {
        return yyHospitalDepartmentMapper.insertYyHospitalDepartment(yyHospitalDepartment);
    }

    /**
     * 修改科室
     *
     * @param yyHospitalDepartment 科室
     * @return 结果
     */
    @Override
    public int updateYyHospitalDepartment(YyHospitalDepartment yyHospitalDepartment)
    {
        return yyHospitalDepartmentMapper.updateYyHospitalDepartment(yyHospitalDepartment);
    }

    /**
     * 批量删除科室
     *
     * @param departmentIds 需要删除的科室主键
     * @return 结果
     */
    @Override
    public int deleteYyHospitalDepartmentByDepartmentIds(String departmentIds)
    {
        return yyHospitalDepartmentMapper.deleteYyHospitalDepartmentByDepartmentIds(Convert.toStrArray(departmentIds));
    }

    /**
     * 删除科室信息
     *
     * @param departmentId 科室主键
     * @return 结果
     */
    @Override
    public int deleteYyHospitalDepartmentByDepartmentId(Long departmentId)
    {
        return yyHospitalDepartmentMapper.deleteYyHospitalDepartmentByDepartmentId(departmentId);
    }
}
